package com.sike.service;

import com.sike.entity.OrderItem;
import com.sike.mapper.OrderItemMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author vito
 * @version 1.0
 */
@Service
public class OrderItemService {
    @Autowired
    private OrderItemMapper orderItemMapper;

    public void addOrderItem(OrderItem orderItem) {
        orderItemMapper.insertOrderItem(orderItem);
    }

    public List<OrderItem> getOrderItemsByOrderId(Integer orderId) {
        return orderItemMapper.findOrderItemsByOrderId(orderId);
    }
}
